package org.znxs.znxsojjudge.codeSandbox;


import org.znxs.znxsojjudge.codeSandbox.impl.ExampleCodeSandbox;
import org.znxs.znxsojjudge.codeSandbox.impl.RemoteCodeSandbox;
import org.znxs.znxsojjudge.codeSandbox.impl.ThirdPartyCodeSandbox;

/**
 * 代码沙箱接口
 */
public class CodeSandboxFactory {
    /**
     * 代码工厂创建对应的实例
     */
    public static CodeSandbox newInstance(String type) {
        switch (type) {
            case "remote":
                return new RemoteCodeSandbox();
            case "third":
                return new ThirdPartyCodeSandbox();
            case "example":
            default:
                return new ExampleCodeSandbox();
        }

    }
}
